package com.mapstruct.domain;

import com.mapstruct.dp.CarType;

import java.util.List;
import java.util.Objects;

/**
 * do对象
 */
public class Car {

    private String make;//制造
    private int numberOfSeats;//座位数
    private CarType type;//值对象

    public Car(String make, int numberOfSeats, CarType type) {
        this.make = make;
        this.numberOfSeats = numberOfSeats;
        this.type = type;
    }

    public String getMake() {
        return make;
    }

    public void setMake(String make) {
        this.make = make;
    }

    public int getNumberOfSeats() {
        return numberOfSeats;
    }

    public void setNumberOfSeats(int numberOfSeats) {
        this.numberOfSeats = numberOfSeats;
    }

    public CarType getType() {
        return type;
    }

    public void setType(CarType type) {
        this.type = type;
    }

    public void move(){
        if(Objects.nonNull(type.getColour())){
            System.out.println("有颜色的车");
        }else{
            System.out.println("不是车");
        }
    }
}
